package com.cmwa.scbp.sys.userInfo.entity;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.type.Alias;

import com.cmwa.scbp.base.mvc.entity.BaseVo;
import com.cmwa.scbp.utils.DateUtils;

@Alias("userInfoVo")
public class UserInfoVo extends BaseVo {

	/** 用户id */
	private String empID;

	/** 用户名 */
	private String empName;
	private String password;

	/**
	 * 登陆KM的用户名
	 */
	private String login;

	/** 父机构ID */
	private String reorgId;

	/** 父机构名称 */
	private String reOrgName;

	/** 父机构状态 */
	private String reorgstat;

	/** 机构ID */
	private String orgId;

	/** 机构名称 */
	private String orgName;

	/** 二级机构id */
	private String secondOrgid;

	/** 二级机构名称 */
	private String secondOrgname;

	/** 二级机构状态 */
	private String secondstat;

	/** 岗位ID */
	private String titleId;

	/** 岗位名称 */
	private String titleName;
	/** 用户简称 **/
	private String empSName;

	/**
	 * 用户状态, STAR启用
	 */
	private String empStat;

	/**
	 * 岗位状态
	 */
	private String ormemberStat;

	/** 用户邮箱 */
	private String empEmail;

	/** 20170830 ex-wulj 新增属性 开始 */

	private String idCard;
	private String empTelOff;
	private String empMobile;
	private String orgStat;

	private int searchOrder; // 搜索的时候顺序号

	private String empType; // 员工类型 IN 内部 OUT 外部

	private Boolean existSecondOrg;

	private String company;

	private String companyName;

	private String dueDate; // 到期日

	public String getOrgStat() {
		return orgStat;
	}

	public void setOrgStat(String orgStat) {
		this.orgStat = orgStat;
	}

	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public String getEmpTelOff() {
		return empTelOff;
	}

	public void setEmpTelOff(String empTelOff) {
		this.empTelOff = empTelOff;
	}

	public String getEmpMobile() {
		return empMobile;
	}

	public void setEmpMobile(String empMobile) {
		this.empMobile = empMobile;
	}

	/** 20170830 ex-wulj 新增属性 结束 */

	public String getEmpID() {
		return empID;
	}

	public void setEmpID(String empID) {
		this.empID = empID;
	}

	public String getEmpName() {
		return empName;
	}

	public void setEmpName(String empName) {
		this.empName = empName;
	}

	public String getReorgId() {
		return reorgId;
	}

	public void setReorgId(String reorgId) {
		this.reorgId = reorgId;
	}

	public String getReOrgName() {
		return reOrgName;
	}

	public void setReOrgName(String reOrgName) {
		this.reOrgName = reOrgName;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public String getSecondOrgid() {
		return secondOrgid;
	}

	public void setSecondOrgid(String secondOrgid) {
		this.secondOrgid = secondOrgid;
	}

	public String getSecondOrgname() {
		return secondOrgname;
	}

	public void setSecondOrgname(String secondOrgname) {
		this.secondOrgname = secondOrgname;
	}

	public String getTitleId() {
		return titleId;
	}

	public void setTitleId(String titleId) {
		this.titleId = titleId;
	}

	public String getTitleName() {
		return titleName;
	}

	public void setTitleName(String titleName) {
		this.titleName = titleName;
	}

	public String getEmpSName() {
		return empSName;
	}

	public void setEmpSName(String empSName) {
		this.empSName = empSName;
	}

	public String getEmpStat() {
		return empStat;
	}

	public void setEmpStat(String empStat) {
		this.empStat = empStat;
	}

	public String getEmpStatNm() {
		if (StringUtils.equals(empStat, "STAR")) {
			return "正常";
		} else if (StringUtils.equals(empStat, "DELE")) {
			return "删除";
		} else if (StringUtils.equals(empStat, "STOP")) {
			return "停止";
		} else {
			return empStat;
		}
	}

	public String getOrmemberStat() {
		return ormemberStat;
	}

	public void setOrmemberStat(String ormemberStat) {
		this.ormemberStat = ormemberStat;
	}

	public String getEmpEmail() {
		return empEmail;
	}

	public void setEmpEmail(String empEmail) {
		this.empEmail = empEmail;
	}

	@Override
	public String toString() {
		return "UserInfoVo [empID=" + empID + ", empName=" + empName + ", reorgId=" + reorgId + ", reOrgName="
				+ reOrgName + ", orgId=" + orgId + ", orgName=" + orgName + ", secondOrgid=" + secondOrgid
				+ ", secondOrgname=" + secondOrgname + ", titleId=" + titleId + ", titleName=" + titleName
				+ ", empEmail=" + empEmail + "]";
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public int getSearchOrder() {
		return searchOrder;
	}

	public void setSearchOrder(int searchOrder) {
		this.searchOrder = searchOrder;
	}

	public String getReorgstat() {
		return reorgstat;
	}

	public void setReorgstat(String reorgstat) {
		this.reorgstat = reorgstat;
	}

	public String getSecondstat() {
		return secondstat;
	}

	public void setSecondstat(String secondstat) {
		this.secondstat = secondstat;
	}

	public String getEmpTypeNm() {
		if ("IN".equals(empType)) {
			return "内部";
		} else if ("OUT".equals(empType)) {
			return "外部";
		} else {
			return empType;
		}
	}

	public String getEmpType() {
		return empType;
	}

	public void setEmpType(String empType) {
		this.empType = empType;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Boolean getExistSecondOrg() {
		return existSecondOrg;
	}

	public void setExistSecondOrg(Boolean existSecondOrg) {
		this.existSecondOrg = existSecondOrg;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getDueDate() {
		return dueDate;
	}

	public void setDueDate(String dueDate) {
		this.dueDate = dueDate;
	}
	
	public boolean isDue() {
		if(StringUtils.isBlank(dueDate)) {  // 没有过期日，说明永远不过期
			return false;
		}
		int compare = DateUtils.compare(dueDate, DateUtils.getNowStr(DateUtils.DATE_FORMAT_yMd_EN), DateUtils.DATE_FORMAT_yMd_EN);
		// 过期日小于当前时间，已过期
		return compare < 0 ? true : false; 
	}

}
